package com.link2room.bumblebee.controller.inside;


import com.link2room.bumblebee.dto.param.base.TagBaseParamDto;
import com.link2room.bumblebee.dto.result.base.TagBaseDto;
import com.link2room.bumblebee.facade.ITagBaseFacadeService;
import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.common.jpa.result.QueryResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 获取sysOptions
 * Created by Ln on 2016/12/20.
 */
@Api(tags = "获取tags")
@RestController
@RequestMapping("/in/TagBases")
public class TagBaseInsideController {
    @Resource
    private ITagBaseFacadeService tagBaseFacadeService;

    @ApiOperation(value = "tag列表", response = TagBaseDto.class)
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "tagType",value = "tagType", paramType = "query", required = true),
    })
    @RequestMapping(method= RequestMethod.GET)
    public @ResponseBody
    BaseResultDto tagBaseList(
            @RequestParam(value = "tagType" ,required = true) String tagType
    ) throws Exception {
        TagBaseParamDto paramDto = new TagBaseParamDto();
        paramDto.setTagType(tagType);
        QueryResult<TagBaseDto> res = tagBaseFacadeService.listTagBases(paramDto);
        BaseResultDto l2rRs=new BaseResultDto();
        l2rRs.setResultCode(0);
        l2rRs.setQueryResult(res);
        return l2rRs;
    }
}
